package cn.plushine.service;

import cn.plushine.mapper.BasePOrderMapper;
import cn.plushine.mapper.BaseTransferMapper;
import cn.plushine.pojo.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.HashMap;
import java.util.List;


/**
 * 调拨订单接口实现类
 */
@Service
public class BaseTransferServiceImpl implements BaseTransferService {

    @Autowired
    BaseTransferMapper baseTransferMapper;

    // 获取调拨订单
    @Override
    public List<Transfer> get() {
        return baseTransferMapper.get();
    }

    // 获取仓库信息（库-区-位）
    @Override
    public List<Cascader> warehouse() {
        return baseTransferMapper.warehouse();
    }

    // 获取货物列表
    @Override
    public List<Goods> getGoods(int id) {
        return baseTransferMapper.getGoods(id);
    }

    // 查询货物单位（库存、品牌）
    @Override
    public TransferItem getUnit(int id, int o3) {
        return baseTransferMapper.getUnit(id, o3);
    }

    // 添加调拨订单
    @Override
    public int add(String id, Date date, int o1, int o2, int o3, int i1, int i2, int i3) {
        return baseTransferMapper.add(id, date, o1, o2, o3, i1, i2, i3);
    }

    // 添加调拨订单记录
    @Override
    public int addTransferItem(String id, int goodsId, int o3, int num) {
        return baseTransferMapper.addTransferItem(id, goodsId, o3, num);
    }

    // 获取调拨货物信息
    @Override
    public List<TransferItem> getTransfer(String id) {
        return baseTransferMapper.getTransfer(id);
    }

    // 获取调拨订单对应的调出位置
    @Override
    public Transfer getPosition(String id) {
        return baseTransferMapper.getPosition(id);
    }

    // 批量调拨
    @Override
    public int modify(List<TransferItem> multiplySelect, int i1, int i2, int i3) {
        return baseTransferMapper.modify(multiplySelect, i1, i2, i3);
    }

    // 删除调拨订单
    @Override
    public int delete(String id) {
        return baseTransferMapper.delete(id);
    }

    // 恢复货物信息
    @Override
    public int cancel(String id) {
        return baseTransferMapper.cancel(id);
    }
}
